import java.util.Scanner;

/**
 * 输入一个正整数，计算它在二进制下的1的个数。
 */
public class HJ62 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNext()){
            int num = scanner.nextInt();

            int count = 0;
            while (num > 0){
                if((num & 1)==1){
                    count++;
                }
                num >>=1;
            }

            System.out.println(count);
        }
    }
}
